<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<h:outputStylesheet library="css" name="style.css" />
	<title>SGC Web</title>
</h:head>
<h:body>
	<!-- 	<h:graphicImage url="/resources/images/Logo_small.jpg"></h:graphicImage> -->
	<h:panelGrid columns="3">
		<h:outputLabel styleClass="title" value="SGC Web" />
		<h:outputLabel styleClass="title" value="-" />
		<h:outputLabel styleClass="title"
			value="#{checkUserBean.usuario.company}" />
	</h:panelGrid>
	<h:panelGroup styleClass="alignmentRight">
		<h:panelGrid columns="2" columnsClasses="alignmentRight" border="0">
			<h:outputLabel value="Usuario:" />
			<h:outputText value="#{checkUserBean.usuario.descrip}" />
		</h:panelGrid>
	</h:panelGroup>
	<p:spacer height="10" />
	<h:form>
		<p:tabView id="tabView" activeIndex="#{userBean.tabindex}">
			<p:tab id="detail" title="Detalle de Usuario">
				<p:panel id="pnldeta">
					<p:panel>
						<h:panelGroup styleClass="alignmentLeft">
							<h:panelGrid columns="2" columnsClasses="alignmentLeft"
								border="0">
								<h:outputLabel value="ID:" />
								<h:inputText value="#{userBean.user.name}" size="10" />
								<h:outputLabel value="Password:" />
								<h:inputSecret value="#{userBean.user.password}" size="10" />
								<h:outputLabel value="Nombre:" />
								<h:inputText value="#{userBean.user.descrip}" size="50" />
								<h:outputLabel value="Empresa:" />
								<h:selectOneMenu value="#{userBean.user.company}">
									<f:selectItems value="#{companyBean.nameList }" />
								</h:selectOneMenu>
								<h:outputLabel value="Rol:" />
								<h:selectOneMenu value="#{userBean.user.rol}">
									<f:selectItems value="#{rolBean.rolList }" />
								</h:selectOneMenu>
								<h:outputLabel value="Status:" />
								<h:selectOneMenu value="#{userBean.user.status}">
									<f:selectItems value="#{statusBean.statusUserList}" />
								</h:selectOneMenu>
								<h:outputLabel value="Super Usuario:" />
								<h:selectBooleanCheckbox value="#{userBean.user.superuser}"
									title="Super Usuario:" />
							</h:panelGrid>
						</h:panelGroup>
					</p:panel>
					<p:spacer height="50" width="5" />
					<p:splitButton value="Grabar" update="msgs tabresu"
						actionListener="#{userBean.save}" icon="ui-icon-disk">
						<p:separator />
						<p:menuitem value="Inicio" url="navegacion.xhtml"
							icon="ui-icon-extlink" />
						<p:menuitem value="Salir" url="index.xhtml" icon=".ui-icon-power"
							actionListener="#{checkUserBean.logout}" />
					</p:splitButton>
					<h:panelGrid columns="1">
						<p:messages id="msgs" />
					</h:panelGrid>
				</p:panel>
			</p:tab>
			<p:tab id="resumen" title="Resumen de usuarios">
				<p:panel id="pnlresu">
					<h:dataTable value="#{userBean.userList}" var="c" id="tabresu"
						binding="#{userBean.htmlDataTable}" styleClass="order-table"
						headerClass="order-table-header"
						rowClasses="order-table-odd-row,order-table-even-row">
						<h:column>
							<f:facet name="header">ID</f:facet>#{c.name} </h:column>
						<h:column>
							<f:facet name="header">Nombre</f:facet>#{c.descrip} </h:column>
						<h:column>
							<f:facet name="header">Empresa</f:facet>#{c.company} </h:column>
						<h:column>
							<f:facet name="header">Rol</f:facet>#{c.rol} </h:column>
						<h:column>
							<f:facet name="header">Status</f:facet>#{c.status} </h:column>
						<h:column>
							<h:commandButton title="Editar"
								image="/resources/images/icon_edit.JPG"
								action="#{userBean.edit}">
							</h:commandButton>
						</h:column>
					</h:dataTable>
				</p:panel>
				<p:spacer height="50" width="5" />
				<p:commandButton value="Imprimir" type="button" icon="ui-icon-print">
					<p:printer target="tabresu" />
				</p:commandButton>
			</p:tab>
		</p:tabView>
		<p:spacer height="10" />
		<address>Net Studio</address>
	</h:form>
</h:body>
</html>